package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @InterfaceName: DishesFlavorsMapper
 * @Author: YuanDing
 * @Date: 2024/2/3 21:53
 * @Description:
 */

@Mapper
public interface DishesFlavorsMapper {

    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> selectFlavors(Integer id);

    /**
     * 批量插入菜品口味
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 根据dish_Id 删除菜品
     * @param id
     */
    @Delete("delete from dish_flavor where dish_id = #{id}")
    void deleteDishFlavors(Long id);
}
